package com.xhb.dubbo.service.impl;

import com.xhb.dubbo.api.StudentService;
import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;

/**
 * @Author: gaoh
 * @Date: create in 2021/5/13 19:25
 * @Version:
 * @Description:
 */
@Service
@Component
public class StudentServiceImpl implements StudentService {

    @Autowired
    private Environment environment;

    @Override
    public String getStudent(String id) {
        String port = environment.getProperty("server.port");
        String applicationName = environment.getProperty("spring.application.name");
        String dubboName = environment.getProperty("dubbo.application.name");
        System.out.println("端口：" + port);
        System.out.println("服务：" + applicationName);
        System.out.println("dubboName：" + dubboName);
        return "student:" + id;
    }

}
